{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Split Transform Method\n", "\n", "In this example we will demonstrate the split transform method for analyzing the imaging performance of a mirror. We begin as usual by importing the relevant classes." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from prysm import Interferogram, Pupil, PSF, sample_files\n", "\n", "from matplotlib import pyplot as plt\n", "%matplotlib inline\n", "plt.style.use('bmh')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "p = sample_files('dat') # sample Zygo .dat file, will be downloaded on demand and saved locally\n", "i = Interferogram.from_zygo_dat(p)\n", "i.crop().mask('circle', 40).crop()\n", "i.remove_piston_tiptilt_power()\n", "i.plot2d(clim=100, interpolation=None) # verify the phase looks OK\n", "plt.grid(False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you are dissatisfied with the masking prowess of prysm, it is recommended to use the software that came with your interferometer. The order of operations from here is very important. Because prysm modifies these classes in-place, we should propagate the PSF before filling the interferogram for PSF analysis." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pu = Pupil.from_interferogram(i)\n", "psf = PSF.from_pupil(pu, efl=200, Q=2) # F/2\n", "i.fill()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can then plot," ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots()\n", "i.psd().slices().plot('azavg', fig=fig, ax=ax, invert_x=True, xlim=(25, 0.25), lw=2)\n", "fig, ax = plt.subplots()\n", "# bicubic is highly recommended when the view is small with many pixels\n", "psf.plot2d(xlim=psf.support / 2,\n", " clim=(1e-9,1e0), log=True,\n", " interpolation='bicubic',\n", " fig=fig, ax=ax)\n", "plt.grid(False)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }